/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sbbs.jpa.entity.nationalized;

import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.Nationalized;
import org.sbbs.jpa.entity.UUIDBaseEntity;

/**
 *
 * @author Mr.fdc <fdc_messenger@126.com>
 */
@Entity
@Table(name = "product_national")
public class ProductWithNationalized extends UUIDBaseEntity {

    private String name;
    private String nationalName;

    @Column(name = "national_name")
//    @Nationalized
    public String getNationalName() {
        return nationalName;
    }

    public void setNationalName(String nationalName) {
        this.nationalName = nationalName;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 97 * hash + Objects.hashCode(this.name);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ProductWithNationalized other = (ProductWithNationalized) obj;
        if (!Objects.equals(this.name, other.name)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ProductWithNationalized{" + "name=" + name + '}';
    }

}
